<?php
/**
 *
 *
 */
class TicketDetail extends AppModel
{
    public $name       = "TicketDetail";
    public $primaryKey = "ticketDetailId";


    public function get_id($ticketId)
    {
        //return self::find('first', array('conditions' => array('ticketId' => $ticketId, 'action_taken IS' => 'NULL', 'recommendation IS' => 'NULL'), 'fields' => array('ticketDetailId')));
        $sql = "select `ticketDetailId` from `ticket_details` where `ticketId`={$ticketId} order by date_taken_action asc limit 1";
        return self::query($sql);
    }

    public function get_detail($marker = 'all', array $conditions, $fields = array('*'), $orderby = null, $groupby = null)
    {
        return self::find($marker, array('conditions' => $conditions, 'fields' => $fields, 'order' => $orderby, 'group' => $groupby));
    }
}
?>